﻿using System;

namespace MikeKappel.Com.CS
{
    public static partial class Helper
    {
        /// <summary>
        /// Looks for key retruns segement after key segment.
        /// </summary>
        /// <param name="UrlLocalPath">Virtual Local Path</param>
        /// <param name="key">String to find</param>
        /// <returns>Segement after key segment</returns>
        public static String FindInUrl(String UrlLocalPath, String key)
        {
            String result = "";
            String[] folders = UrlLocalPath.Split('/');
            if (folders.Length > 2)
            {
                for (Int32 i = 0; i < (folders.Length - 1); i++)
                {
                    if (folders[i].ToLower().Trim() == key.ToLower().Trim())
                        result = folders[i + 1].Trim();
                }
            }
            return result;
        }
	}
}
